package com.baitengsoft.patentapimonitor.common.utils;


/**
 * @author Chen 2017/12/18
 */
public class SearchParam {
    private String order;//排序方式 asc升序、desc降序
    private String sort;//排序的列
    private Integer pageNumber = 1;//页号
    private Integer pageSize = 10;//每页数据

    public SearchParam() {
    }

    public Integer getPageNumber() {
        return this.pageNumber;
    }

    public void setPageNumber(Integer pageNumber) {
        if(pageNumber < 1) {
            throw new IllegalArgumentException("pageNumber 参数不能小于 1。");
        } else {
            this.pageNumber = pageNumber;
        }
    }

    public Integer getPageSize() {
        return this.pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if(pageSize < 0) {
            throw new IllegalArgumentException("pageSize 参数不能小于 0。");
        } else {
            this.pageSize = pageSize;
        }
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        if (order.equals("desc")||order.equals("asc")){
            this.order = order;
        }else {
            this.order = "";
        }
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }
}